# -*- coding: utf-8 -*-

import time
from report import report_sxw
import pooler
from osv import osv
from tools.translate import _
import random
from datetime import datetime
        
class Parser(report_sxw.rml_parse):
        
    def __init__(self, cr, uid, name, context):
        super(Parser, self).__init__(cr, uid, name, context=context)
        self.context = context
        self.pool = pooler.get_pool(cr.dbname)
        self.course_obj = self.pool.get('aas.course.list')
        
        self.localcontext.update({
            'init': self._init,
            'lines': self.get_lines,
            'course_obj': self.course_obj,
            'today': datetime.today(),
        })
    
    def _init(self, exam_schedule):
        self.lines = self.course_obj.get_all_lines(self.cr, self.uid, exam_schedule.id)
        return True
    
    def get_lines(self):
        return self.lines
    
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
